Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Application-Defined Functions / Modal-Dialog Filter Functions


MyModalFilter

A modal-dialog filter function whose address is passed to CustomGetFilePreview should have the following form:

pascal Boolean MyModalFilter (DialogPtr theDialog, 
                              EventRecord *theEvent, 
                              short itemHit, Ptr myDataPtr);
theDialog
A pointer to the dialog structure of the dialog box.
theEvent
A pointer to the event structure for the event.
itemHit
The number of the item selected.
myDataPtr
A pointer to the optional data whose address is passed to CustomGetFilePreview.
DESCRIPTION
Your modal-dialog filter function determines how the Dialog Manager's ModalDialog routine filters events. The ModalDialog routine retrieves events by calling the Event Manager's GetNextEvent routine. The Standard File Package contains an internal filter function that performs some preliminary processing on each event it receives. If you provide a modal-dialog filter function, ModalDialog calls your filter function after it calls the internal Standard File Package filter function and before it sends the event to your dialog hook function.

Your modal-dialog filter function returns a Boolean value that reports whether it handled the event. If your function returns a value of false, ModalDialog processes the event through its own filters. If your function returns a value of true, ModalDialog returns with no further action.

SEE ALSO
See Inside Macintosh: Files for another sample modal-dialog filter function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996